package com.awcall.iot.model;

import java.io.Serializable;

import com.baomidou.mybatisplus.enums.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 权限表
 * </p>
 *
 * @author wuhui
 * @since 2018-03-05
 */
@TableName("bd_authority")
public class Authority extends Model<Authority> {

    private static final long serialVersionUID = 1L;

	@TableId(value="id", type= IdType.AUTO)
	private Integer id;
    /**
     * 权限名称
     */
	@TableField("authority_name")
	private String authorityName;
	@TableField("parent_id")
	private Integer parentId;
    /**
     * 地址
     */
	private String path;
    /**
     * 标题
     */
	private String title;
    /**
     * 组件
     */
	private String component;
    /**
     * 排序号
     */
	private Integer order;
	@TableField(value = "created_at", fill = FieldFill.INSERT)
	private Date createdAt;
	@TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
	private Date updatedAt;

	@TableField(exist = false)
	private List<Authority> authorityList;
	@TableField(exist = false)
	private String parentTitle;
	@TableField(exist = false)
	private List<RoleAuthority> roleAuthorityList;
	@TableField(exist = false)
	private Boolean checked;

	public Boolean getChecked() {
		return checked;
	}

	public Authority setChecked(Boolean checked) {
		this.checked = checked;
		return this;
	}

	public List<RoleAuthority> getRoleAuthorityList() {
		return roleAuthorityList;
	}

	public Authority setRoleAuthorityList(List<RoleAuthority> roleAuthorityList) {
		this.roleAuthorityList = roleAuthorityList;
		return this;
	}

	public String getParentTitle() {
		return parentTitle;
	}

	public Authority setParentTitle(String parentTitle) {
		this.parentTitle = parentTitle;
		return this;
	}

	public List<Authority> getAuthorityList() {
		return authorityList;
	}

	public Authority setAuthorityList(List<Authority> authorityList) {
		this.authorityList = authorityList;
		return this;
	}

	public Integer getId() {
		return id;
	}

	public Authority setId(Integer id) {
		this.id = id;
		return this;
	}

	public String getAuthorityName() {
		return authorityName;
	}

	public Authority setAuthorityName(String authorityName) {
		this.authorityName = authorityName;
		return this;
	}

	public Integer getParentId() {
		return parentId;
	}

	public Authority setParentId(Integer parentId) {
		this.parentId = parentId;
		return this;
	}

	public String getPath() {
		return path;
	}

	public Authority setPath(String path) {
		this.path = path;
		return this;
	}

	public String getTitle() {
		return title;
	}

	public Authority setTitle(String title) {
		this.title = title;
		return this;
	}

	public String getComponent() {
		return component;
	}

	public Authority setComponent(String component) {
		this.component = component;
		return this;
	}

	public Integer getOrder() {
		return order;
	}

	public Authority setOrder(Integer order) {
		this.order = order;
		return this;
	}

	public Date getCreatedAt() {
		return createdAt;
	}

	public Authority setCreatedAt(Date createdAt) {
		this.createdAt = createdAt;
		return this;
	}

	public Date getUpdatedAt() {
		return updatedAt;
	}

	public Authority setUpdatedAt(Date updatedAt) {
		this.updatedAt = updatedAt;
		return this;
	}

	public static final String ID = "id";

	public static final String AUTHORITY_NAME = "authority_name";

	public static final String PARENT_ID = "parent_id";

	public static final String PATH = "path";

	public static final String TITLE = "title";

	public static final String COMPONENT = "component";

	public static final String ORDER = "order";

	public static final String CREATED_AT = "created_at";

	public static final String UPDATED_AT = "updated_at";

	@Override
	protected Serializable pkVal() {
		return this.id;
	}

	@Override
	public String toString() {
		return "Authority{" +
			", id=" + id +
			", authorityName=" + authorityName +
			", parentId=" + parentId +
			", path=" + path +
			", title=" + title +
			", component=" + component +
			", order=" + order +
			", createdAt=" + createdAt +
			", updatedAt=" + updatedAt +
			"}";
	}
}
